<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>聚美优品-美妆商城-内容页</title>
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/content.css"/>
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/style.css"/>
	<script src="__PUBLIC__/js/jquery-1.7.2.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="__PUBLIC__/js/list.js" type="text/javascript" charset="utf-8"></script>
	<script src="__PUBLIC__/js/header.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		$(function(){
			$('.big_pic_list li').first().css('display','block');
			$('.biggest_pic ul li').first().show().siblings('li').hide();

			// 产品规格部分js
			$('#pro-info .jingxuan .price .spec span').first().addClass('cur');
			$('#pro-info .jingxuan .price .spec span').click(function() {
				$(this).addClass('cur').siblings('span').removeClass('cur');
			});
		})
	</script>
</head>
<body style="background: #F7F7F7">
	
<include file='__PUBLIC__/header.html'/>
	
	<!-- <div id="top-d2">
		<div class="center">
			<div class="logo"><a href=""> </a></div>
			<div class="cart"><a href="">去购物车结算</a></div>
		</div>
	</div> -->

	<!-- 产品内容信息 -->
	<div id="pro-info">
		<div class="pro-pic">
			<ul class="big_pic_list">
			<foreach from="$goodData['mid_pic']" key="$k" value="$v">
				<li><img src="__ROOT__/{$v}" alt="" /></li>
			</foreach>
			</ul>
			<b class="fangkuai"></b>
			<div id="cover"></div>
			<div class="smlpic">
				<a class="pre" href="javascript:;"></a>
				<a class="next disabled" href="javascript:;"></a>
				<div class="pic_ul">
					<ul>
					<foreach from="$goodData['small_pic']" key="$k" value="$v">
						<li><img src="__ROOT__/{$v}" alt="" /></li>
					</foreach>
					</ul>
				</div>
			</div>
		</div>	
		<div class="biggest_pic">
			<ul>
			<foreach from="$goodData['big_pic']" key="$k" value="$v">
				<li><img src="__ROOT__/{$v}" alt="" /></li>
			</foreach>
			</ul>
		</div>
		
		<div class="jingxuan">
				<h3 class="title">
					<p>{$goodData.gname}</p>
					<!-- <span>Mediheal N.M.F aqaring ampoule mask</span> -->
				</h3>
				<div class="logo">
					<img src="__ROOT__/{$goodData.logo}" style="width: 120px;height: 60px;" />
					<!--<p>{$goodData.bname}</p>-->
					<!-- <span>韩国品牌</span> -->
				</div>
				<div class="des">{$goodData.msg}</div>
				<div class="price">
					<div class="a1">
						¥<span class="b1" money="{$goodData.mall_price}">{$goodData.mall_price}</span><span class="b2"> ¥{$goodData.market_price}</span>
					</div>
					<!--<div class="a2">价格明细 》</div>-->
					<!-- <div class="a3">海外官网价：₩30000 &nbsp;&nbsp;(约¥166.9)</div> -->
					<div class="color">
						<span>净含量:</span>
						<ul class="attr">
							<foreach from="$goodData['capacity']" key="$k" value="$v">
								<li>
									<a href="javascript:;" gaid="{$v['gaid']}">{$v.attr}</a>
								</li>
							</foreach>
						</ul>
						<script type="text/javascript">
							$('.color .attr li').click(function() {
								$(this).addClass('onclick').siblings('li').removeClass('onclick');
							});
						</script>
					</div>
					<div class="size">
						<span>包&nbsp;&nbsp;&nbsp;&nbsp;装:</span>
						<ul class="attr">
							<foreach from="$goodData['pack']" key="$k" value="$v">
								<li>
									<a href="javascript:;" gaid="{$v['gaid']}">{$v.attr}</a>
								</li>
							</foreach>
							
						</ul>
						<script type="text/javascript">
							$('.size .attr li').click(function() {
								$(this).addClass('onclick').siblings('li').removeClass('onclick');
							});
						</script>
						<p style="margin-top:5px;float:left;display:none" id="total-box">库存: <strong id="total">0</strong> 件</p>
					</div>
				</div>		
				<div class="mianshui">
					<p class="a1">极速免税</p>
					<p class="a2">极速免税店，最快24小时到货<span>（比海外发货快15天）</span></p>
					<p class="a3">极速免税店，满2件或满299包邮（邮费5元） | 限购1件</p>
				</div>
				<div class="buy">41222<span>人已购买</span></div>
				<div class="time">本特卖剩余时间&nbsp;<span>5天23:04:28</span></div>
				<div class="xian"></div>
				<script type="text/javascript">
				$(function(){
					$('.attr li').click(function() {
						if ($('.onclick').length>=2) {
							var group = '';
							$.each($('.onclick'), function(k, v) {
								 group += ','+$(this).find('a').attr('gaid');
							});
							$.ajax({
								url: "{|U:'Content/ajax_size'}",
								type: 'POST',
								dataType: 'json',
								data: {group:group,gid:{$hd.get.gid}},
								success:function(data){
									$('#total').html(data[0]);
									$('#total-box').show();
									if (data[0]==0) {
										$('.join-car').addClass('null');
										$('.join-car').attr('on', '0');
									}else{
										$('.join-car').removeClass('null');
										$('.join-car').attr('on', '1');
									}
									var money = $('.b1').attr('money');
									var now_money = money*1+data[1];
									$('.b1').html(now_money);
//										$('.b1').html(now_money+'.00');
								}
							})
						};
					});
					$('.join-car').click(function() {
						if ($('.null').length<1 && $('.onclick').length>=2) {
							var group = '';
							$.each($('.onclick'), function(k, v) {
								 group += ','+$(this).find('a').attr('gaid');
							});
							var path = "{|U:'Index/Content/index'}";
							var price = $('.b1').html();
                            
							$.ajax({
								url: "{|U:'Cart/ajax_cart'}",
								type: 'POST',
								dataType: 'json',
								data: {group:group,gid:{$hd.get.gid},price:price},
								success:function(data){
									// <a href="{|U:'Content/index',array('gid'=>$v['id'])}" class="cart-good-title" target="_blank">{$v.name}</a>
									var str ='';	
									$.each(data['cart']['goods'], function(k, v) {
										str += '<li class="cart-good">';
										str += '<img src="';
										str += '__ROOT__/'+v.options.logo+'"';
										str += 'alt="" class="cart-good-img" />';
										str += '<a href="';
										str += path;
										str += '/gid/'
										str += v.id;
										str += '"';
										str += 'class="cart-good-title" target="_blank">';
										str += v.name;
										str += '</a><p class="b1"><span>￥';
										str += v.price;
										str += '</span> x ';
										str += v.num;
										str += '</p></li>';
									});
									str += '<div class="bottom-go"><div class="money-left">';
									str += '<p class="good-num">';
									str += '共 <span>';
									str += data['cart']['total_rows'];
									str += '</span> 件商品</p>';
									str += '<p class="good-money">共计<span class="logo">￥</span><span>';
									str += data['cart']['total'];
									str += '</span></p></div>';
									str += '<a href="';
									str += "{|U:'Index/Cart/index'}";
									str += '" class="go-pay">';
									str += '去购物车结算</a></div></div>';
									
									$('.cart-good-list').html(str);
									$('#join-success').fadeIn(300);
								}
							})
							
							
						
						}
						
				    $.ajax({
				    	url: "{|U:'Cart/iflogin'}",
				    	type: 'POST',
				    	success:function(phpdata){
//				    		alert(phpdata);
						
				    		if(phpdata==1){
				    			if ($('.null').length<1 && $('.onclick').length>=2) {
				    				$('#join-success').fadeIn(300);
				    			}else{
				    				alert('请选择净含量和包装');
				    			}
				    		
				    		}
				    		else
				    		{
							if ($('.null').length<1 && $('.onclick').length>=2) {
									alert('请先登陆再进行选购哦!购物车添加成功^o^');
								}else{
									alert('请选择净含量和包装');
								}
				    		}
				    		
				    	}
				    })
					});
				})
				</script>
				<div class="cart" gid="{$goodData.gid}">
					<a href="javascript:;" class="join-car" on="0">
						加入购物车
					</a></div>
			</div>
	</div>

	<!-- 产品详情区块 开始-->
	<div id="details">
		<div class="nav">
			<a href="#info">商品信息</a>
			<a href="#allinfo">商品详情</a>
			<a href="#usemethod">使用方法</a>
			<a href="#photo">商品实拍</a>
	<!--		<a href="#comment">用户口碑</a>
			<a href="#">关于极速免税店</a>-->
		</div>

		<div class="content">
			<div id="info" class="share pro-info">
				<div class="for title"></div>
				<div class="detail">
					<!--商品信息-->
					{$goodData.detail}
				</div>
			</div>
			<div id="allinfo" class="share pro-info">
				<div class="allfor title"></div>
				<div class="detail">
					<!--商品详情-->
					{$goodData.service}
				</div>
			</div>
			<div id="usemethod" class="share pro-info">
				<div class="usefor title"></div>
				<div class="detail">
					<!--使用方法-->
					{$goodData.use_method}
				</div>
			</div>
			<div id="photo" class="share pro-info">
				<div class="photofor title"></div>
				<div class="detail">
					<!--商品实拍-->
					{$goodData.rel_photo}
					
				</div>
			</div>
			

	<!--添加购物车提示成功-->
	<div id="join-success">
		<div id="success-box">
			<p class="success">
				<span class="success-logo"></span>
				已成功加入购物车
			</p>
			<p class="where">
				<a href="javascript:;" class="go-on">继续逛逛</a>
				<a href="{|U:'Cart/index'}" class="go-pay">去购物车结算</a>
			</p>
			<span class="close"></span>
		</div>
	</div>
	<!--添加购物车提示成功结束-->
	<script type="text/javascript">
		$('#success-box .close').click(function() {
			$('#join-success').fadeOut(300);
		});
		$('.go-on').click(function() {
			$('#join-success').fadeOut(300);
		});
	</script>
			
			
			
		</div>

	</div>
	<div id="bt-info">
		<div class="center"></div>
	</div>
	<!-- 产品详情区块 结束-->

</body>
</html>